<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

/** 
* My Controller Class 
* 
* Class to extend CI controller for each controller
*
* @category	Libraries
* @subpackage Extend Controller
* @package ICOMP
* @author sipshop
*/
class MY_Controller extends Controller
{

	var $data=array();
	var $CI;

    function MY_Controller()
	{        
		parent::Controller();  
		$this->CI =& get_instance();
		$this->data['site'] = $this->_get_site();
		$this->data['menu_header'] = $this->_menu_header();
		
	}
	
	private function _menu_header()
	{
		return $this->data['menu_header'] = $this->mymenu->menu_header();
	}
	
	
		
	private function _get_site()
	{
		$site =  $this->CI->Site_model->get_row('*',1);
		if($site)
			return $site;
		else
			redirect('offline');
	}	
	
	
	public function _set_paging_link($paging)
	{
		$data=array();
		$n = 0;
		for ($i=$paging['start'];$i<=$paging['end'];$i++)
		{
			if ($i==$paging['page'])
			{
				$data[$n]['active'] = ' class ="current"';
			}
			else
			{
				$data[$n]['active']="";
			}
			$data[$n]['num'] =$i; 
			$n++;
		}
		
		return $data;
	}
	
	
}
/* End of file MY_Controller.php */ 
/* Location: ./system/application/libraries/MY_Controller.php */ 
?>